function firstElement1(arr: any[]) {
	return arr[0]
}
function firstElement<Type>(arr: Type[]): Type | undefined {
	return arr[0]
}
// const s = firstElement<string>(['a', 'b'])
// const n = firstElement<number>([1, 2])
// const u = firstElement<undefined>([])

// const s = firstElement(['a', 'b', 1])
// const n = firstElement([1, 2])
// const u = firstElement([])

function map<Input, Output>(arr: Input[], func: (arg: Input) => Output): Output[] {
  return arr.map(func)
}
const parsed = map(['1', '2', '3'], (n) => parseInt(n))
